<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="jquery-1.8.2.js"></script>    

<script type="text/javascript">
	$(document).ready(function() {
		
		if(${sessionScope.mvo==null}){
			alert("로그인 하고 오세요");
			location.href="wedding.do?command=loginForm";
		}//sessionscope 체크용
		else{
		
		$("#delete").click(function() {
			location.href="qna.do?command=qnaDelete&qnaNo=${requestScope.qnabvo.qnaNo }";
		});
		$("#update").click(function() {
			location.href="qna.do?command=qnaUpdateGetContent&qnaNo=${requestScope.qnabvo.qnaNo }"
		});
		$("#list").click(function() {
			location.href="qna.do?command=qnaAllBoardList";
		});
		$("#reBtn").click(function() {
			$.ajax({
				type:"GET",
				url:"qna.do",
				data:"command=qnaGetMaxQnaRestep&qnaRef=${requestScope.qnabvo.qnaRef }",
				success : function(data) {
					if(data.step!=0){
						alert("답글쓰기 불가");
					}
					else{
						location.href="qna.do?command=qnaReWriteBeforContent&qnaNo=${requestScope.qnabvo.qnaNo }&page=${requestScope.page }";
					}
					
				} // success
			})//	$.ajax({
		}); // reBtn
		}//session이 있을때 쓴느 것
	});//ready
</script>    

<font size="2" color="#5D5D5D"><b>
글번호 : ${requestScope.qnabvo.qnaNo } | 타이틀:${requestScope.qnabvo.qnaTitle }<hr>
작성자:${requestScope.qnabvo.member.id } | 작성일시:${requestScope.qnabvo.qnaDate } | count: ${requestScope.qnabvo.qnaCount }<hr>
${requestScope.qnabvo.qnaContent }</b></font> <br><br><hr>


<c:if test="${requestScope.qnabvo.qnaRestep==0 }">
<span style="margin-left: 620px;">
	<img src="${initParam.root }/img/update_btn.gif" id="update" >
	 <img src="${initParam.root }/img/delete_btn.gif" id="delete" >
	 <img src="${initParam.root }/img/list_btn.gif" id="list" ></span>
	 <c:if test="${sessionScope.mvo.userLevel==0 }">
	  <img src="${initParam.root }/img/re_btn.gif" id="reBtn" >
	 </c:if>
 </c:if>
 
 <c:if test="${requestScope.qnabvo.qnaRestep==1 }">
 <c:if test="${sessionScope.mvo.userLevel==0 }" >
 <span style="margin-left: 650px;">
<img src="${initParam.root }/img/update_btn.gif" id="update" >
 <img src="${initParam.root }/img/delete_btn.gif" id="delete"></span>
 </c:if>
 <img src="${initParam.root }/img/list_btn.gif" id="list">
</c:if>
